module VirtualCity.Plan

open Casanova
open Casanova.Utilities
open Casanova.Core
open Casanova.Coroutines
open Casanova.Game
open Casanova.Input
open Casanova.Math
open Casanova.Drawing
open VirtualCity.City
open VirtualCity.CityDescription
open VirtualCity.PlanDescription


/// A plan contains a list of steps which represent
/// a series of actions that the agent will perform
/// in order.
type [<CasanovaEntity>] Plan = {
  Steps : List<Step>
}


/// A step of a plan contains the action for this step,
/// but also the description of what the planner expected 
/// to happen after the execution of the current plan.
and [<CasanovaEntity>] Step = {
  Action            : Action
  Expectations      : StepExpectations
}


/// An action can either be:
/// - walk to the end of a road
/// - board a bus and reach one of its stops
/// - use an item
and [<CasanovaEntity>] Action = 
  | Walk of Vector2<m>
  | Board of Ref<Bus * BusStop * BusStop>
  | Use of Ref<Item> * int
